#include    "fuel-tank.h"

//------------------------------------------------------------------------------
//
//------------------------------------------------------------------------------
FuelTank::FuelTank(QObject *parent) : Device(parent)
  , fuel_capacity(0.0)
  , fuel_consumption(0.0)
{

}

//------------------------------------------------------------------------------
//
//------------------------------------------------------------------------------
FuelTank::~FuelTank()
{

}

//------------------------------------------------------------------------------
//
//------------------------------------------------------------------------------
void FuelTank::preStep(state_vector_t &Y, double t)
{
    Q_UNUSED(t)

    Y[0] = cut(Y[0], 0.0, fuel_capacity);
}

//------------------------------------------------------------------------------
//
//------------------------------------------------------------------------------
void FuelTank::ode_system(const state_vector_t &Y,
                          state_vector_t &dYdt,
                          double t)
{
    Q_UNUSED(Y)
    Q_UNUSED(t)

    dYdt[0] = -fuel_consumption;
}

//------------------------------------------------------------------------------
//
//------------------------------------------------------------------------------
void FuelTank::load_config(CfgReader &cfg)
{
    Q_UNUSED(cfg)
}
